package tasks.OpportunitiesBaseData.MainView;
import java.util.ArrayList;

import resources.tasks.OpportunitiesBaseData.MainView.ITSVerifierHelper;
import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.object.interfaces.SAP.*;
import com.rational.test.ft.object.interfaces.WPF.*;
import com.rational.test.ft.object.interfaces.dojo.*;
import com.rational.test.ft.object.interfaces.siebel.*;
import com.rational.test.ft.object.interfaces.flex.*;
import com.rational.test.ft.object.interfaces.generichtmlsubdomain.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;
import com.ibm.rational.test.ft.object.interfaces.sapwebportal.*;
/**
 * Description   : Functional Test Script
 * @author angel.tsvetkov
 */
public class ITSVerifier extends ITSVerifierHelper
{
	/**
	 * Script Name   : <b>ITSVerifier</b>
	 * Generated     : <b>Nov 29, 2011 6:20:41 PM</b>
	 * Description   : Functional Test Script
	 * Original Host : WinNT Version 6.1  Build 7601 (S)
	 * 
	 * @since  2011/11/29
	 * @author angel.tsvetkov
	 */
	public boolean verify()
	{
		boolean result = true;
		String taskReport = "";
			
		ITSFrontEndWrapper frontEndWrapper = new ITSFrontEndWrapper();
		ITSDBWrapper dbContentWrapper = new ITSDBWrapper();
		
		ArrayList<ITSLayout> frontEnd = frontEndWrapper.get();
		
		for(ITSLayout row:frontEnd)
		{
			ITSLayout dbContent = dbContentWrapper.get(row.getDtlKey());
			
			if(row.isEqual(dbContent))
			{
				setComment("Record with Detail Key = " + row.getDtlKey() + " is displayed correctly!");
			}
			else
			{
				setComment("There is an error in displayed record with Detail Key = " + row.getDtlKey());
				
				result = false;
			}
		}

		setTaskResult("Task: Verification of Front End and Database values.", result, taskReport);
		
		return result;
	}
}

